package top.yisen614.dubbo.consumer.controller;

import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import top.yisen614.entity.People;
import top.yisen614.service.PeopleService;

@RestController
public class PeopleController {
    @Reference(version = "1.0.0")
    private PeopleService peopleService;

    @GetMapping("/people/{name}")
    public People getPeople(@PathVariable("name") String name) {
        People people = new People();
        people.setName(name);
        return peopleService.getPeople(people);
    }
}
